<?php echo form_open('admin/voucher/prizes/delete'); ?>

<table border="0" class="table-list">
	<thead>
	<tr>
		<th width="20"><?php echo form_checkbox(array('name' => 'action_to_all', 'class' => 'check-all')); ?></th>
		<th>&nbsp;</th>
		<th><?php echo lang('escort_country_name_title'); ?></th>
		<th><?php echo lang('escort_country_status_title'); ?></th>
		<th width="180"></th>
	</tr>
	</thead>
	<tfoot>
		<tr>
			<td colspan="5">
				<div class="inner"><?php $this->load->view('admin/partials/pagination'); ?></div>
			</td>
		</tr>
	</tfoot>
	<tbody>
		<?php $this->load->library('image_lib');?>
		<?php foreach ($countries as $country): ?>
		<tr>
			<td><?php echo form_checkbox('action_to[]', $country->id); ?></td>
			<td>
			<?php
			if($country->image){
				$this->image_lib->clear();
				$config['image_library'] = 'gd2';
				//$config['image_library'] = 'ImageMagick';
                //$config['library_path'] = '/usr/bin/convert';
				$config['source_image'] = $imagePath.$country->image;
				//$config['new_image'] = $country->image;
				$config['create_thumb'] = TRUE;
				$config['maintain_ratio'] = TRUE;
				$config['width'] = $thumbWidth;
				$config['height'] = $thumbHeight;
				$this->image_lib->initialize($config);
				$this->image_lib->resize();
				//echo $this->image_lib->display_errors();
				
				$imageData = $this->image_lib->explode_name($country->image);
			?>
				<a href="<?php echo site_url().$imageFolder.$country->image?>" class="cboxElement media-photo" target="_blank" rel="group">
					<img src="<?php echo site_url().$imageFolder.$imageData['name'].'_thumb'.$imageData['ext'] ?>" />
				</a>
			<?php
			}
			?>
			</td>
			<td><?php echo $country->name; ?></td>
			<td>
			<?php
			if($country->status){
				echo lang('escort_country_status_active_title');
			}else{
				echo lang('escort_country_status_inactive_title');
			}
			?>
			</td>
			<td class="align-center buttons buttons-small">
				<?php echo anchor('admin/country/edit/' . $country->id, lang('global:edit'), 'class="button edit"'); ?>
				<?php echo anchor('admin/country/delete/' . $country->id, lang('global:delete'), 'class="confirm button delete"') ;?>
			</td>
		</tr>
		<?php endforeach; ?>
	</tbody>
</table>

<div class="table_action_buttons">
<?php $this->load->view('admin/partials/buttons', array('buttons' => array('delete') )); ?>
</div>

<?php echo form_close(); ?>